<%= grid(@shares) do |g|
    g.action_column  object_property: :id
    g.column name: 'ID', attribute: 'id'
    g.column name: '文件名', attribute: 'doc_id' do |share|
      share.doc.nil? ? "" : doc_title(share.doc,"_blank")
    end
    g.column name: '用户', attribute: 'user_id' do |share|
      user_tag share.user
    end
    g.column name: '备注', attribute: 'remark' do |share|
        share.remark
    end
    g.column name: '创建时间',attribute: 'created_at'  do |share|
      time_str share.created_at
    end
    g.column name: '操作员', attribute: 'creator_id' do |share|
      user_tag share.creator
    end
    g.column name: '启用', attribute: 'enabled' do |share|
        boolean_label(share.enabled)
    end
    g.column do |share|
        link_to '删除', share, method: :delete, data: { confirm: 'Are you sure?' }
    end

end %>